package hust.rpc.constants;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.List;

public interface Constants {

    byte[] MAGIC_NUMBER = {'h', 'u', 's', 't'};
    Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;

    byte VERSION = 1;
    byte HEADER_LENGTH = 11;
    int MAX_FRAME_LENGTH = 8 * 1024 * 1024;

    byte CODEC_KRYO = 1;
    byte CODEC_JSON = 2;

    byte REQUEST_TYPE = 1;
    byte RESPONSE_TYPE = 2;
    byte HEARTBEAT_REQUEST_TYPE = 3;
    byte HEARTBEAT_RESPONSE_TYPE = 4;

    String REGISTRY_HOST = "127.0.0.1";
    int REGISTRY_PORT = 8888;

    String PROVIDER_HOST = "127.0.0.1";
    int PROVIDER_PORT = 9002;

    String REGISTRY = "registry";
    String CONSUMER = "consumer";
    String PROVIDER = "provider";

    int CONSUMER_TIME_OUT = 90;
    int PROVIDER_TIME_OUT = 90;
    int CONNECT_TIME_OUT = 60;

    String BASE_SCAN_PACKAGE = "hust.rpc.service";

    String PROVIDER_SERVICE = "hust.rpc.service.ProviderService";

    String CONSUMER_SERVICE = "hust.rpc.service.ConsumerService";
}
